home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / CRS / crs06.d81 / moresmrt.arc / WRITE (.txt) < prev   
GEOS ConVerT  |  2009-10-10  |  6KB  |  254 lines

  1. Write
  2. PRG formatted GEOS file V1.0
  3. NX1000
  4. WRITE
  5. BLASTER'S CONVERTER V2.5
  6. READ ME FIRST
  7. Write Image V2.0
  8. geoWrite    V2.1
  9. @write
  10. clock
  11. .if    Pass1
  12. .include    geosSym
  13. .include    geosMac
  14. .endif
  15. .psect
  16. ProgStart:    jsr    DayofWeek
  17.     PushB    CPU_DATA        ;save
  18. config
  19.     LoadB    CPU_DATA,#$35            ;turn
  20. region
  21.     sei        ;int
  22.     MoveB    cia1base,a0L    ;save
  23.     MoveB    $DC02,a0H    ;save
  24.     LoadB    $DC02,#$0F    ;new
  25. configuration all
  26. o/p's
  27.     LoadB    cia1base,#$0E    ;initial
  28. state
  29. i/o all
  30. lines
  31. false
  32.     jsr    SelClock    ;select
  33. clock
  34.     MoveW    $DC0B,a1L    ;read
  35. hours
  36. TOD temp store
  37.     lsr    a
  38.     lsr    a    ;bring
  39. place
  40.     and    #$20    ;isolate
  41.     ora    a1L    ;retrieve
  42. hours
  43.     and    #$3F    ;clear
  44. msb's
  45.     ora    #$80    ;set
  46. 12/24
  47.     sta    tmphrs    ;save
  48. hours
  49.     MoveW    $DC09,tmpsecs    ;read
  50.     MoveW    $DC0A,tmpmins    ;read
  51. minutes
  52.     lda    $DC08    ;read
  53. secs/10
  54. close
  55.     jsr    WriteByte    ;write
  56.     lda    tmpsecs    ;read
  57. seconds
  58.     jsr    WriteByte
  59.     lda    tmpmins    ;read
  60. minutes
  61.     jsr    WriteByte
  62.     lda    tmphrs    ;retrieve
  63. hours
  64.     jsr    WriteByte
  65.     lda    dayowk    ;read
  66. day of week
  67.     jsr    WriteByte
  68.     lda    day    ;read
  69.     jsr    HextoBCD    ;convert
  70.     jsr    WriteByte
  71.     lda    month    ;read
  72. month
  73.     jsr    HextoBCD    ;convert
  74.     jsr    WriteByte
  75.     lda    year    ;read
  76.     jsr    HextoBCD    ;convert
  77.     jsr    WriteByte
  78.     MoveB    a0L,cia1base    ;restore
  79.     MoveB    a0H,$DC02    ;restore
  80.     PopB    CPU_DATA        ;restore
  81. config
  82.     jmp    EnterDeskTop    ;reload
  83. desktop
  84. @;write
  85. WriteByte:    tax        ;save
  86.     ldy    #8    ;set
  87. count
  88.     LoadB    cia1base,#$0C    ;initial
  89. config output
  90. enable
  91.     txa        ;retrieve
  92. @;write
  93. WriteByte:    tax        ;save
  94.     ldy    #8    ;set
  95. count
  96.     LoadB    cia1base,#$0C    ;initial
  97. config output
  98. enable
  99.     txa        ;retrieve
  100. 10$:    and    #1    ;clr
  101.     sta    cia1base
  102.     ora    #$0C    ;write
  103.     sta    cia1base
  104.     dey        ;decrement
  105. count
  106.     beq    20$    ;finished?
  107.     txa        ;get
  108.     lsr    a    ;select
  109.     tax        ;save
  110. again
  111.     bra    10$    ;loop
  112. 20$:    rts
  113. @;hex
  114. convert
  115. routine
  116. HextoBCD:    ldx    #0    ;clear
  117. 10$:    sta    a1H    ;save
  118. value
  119.     sec        ;set
  120. carry
  121.     sbc    #$0A    ;subtract
  122.     bmi    20$    ;neg?...it's
  123.     inx        ;inc
  124.     bra    10$    ;loop
  125. 20$:    txa        ;count
  126.     asl    a
  127.     asl    a
  128.     asl    a
  129.     asl    a    ;shift
  130. nibble
  131. nibble
  132.     ora    a1H    ;assemble
  133. @;select
  134. clock
  135. SelClock:    lda    #$0E    ;read
  136. cycle
  137. start
  138. dallas
  139.     sta    cia1base
  140.     lda    #2
  141.     sta    cia1base
  142.     lda    #$0E
  143.     sta    cia1base
  144.     LoadB    a2,#2    ;loop
  145. count
  146. 10$:    lda    #$C5
  147.     jsr    WriteByte
  148.     lda    #$3A
  149.     jsr    WriteByte
  150.     lda    #$A3
  151.     jsr    WriteByte
  152.     lda    #$5C
  153.     jsr    WriteByte
  154.     dec    a2    ;decrement
  155. count
  156.     bne    10$
  157. @;ask user for day of week
  158. DayofWeek:    LoadW    r0,#DoWBox
  159.     jsr    DoDlgBox
  160.     sbc    #10
  161.     sta    dayowk
  162. DoWBox:    .byte    DEF_DB_POS | 1
  163.     .byte    DBTXTSTR,16,18
  164.     .word    dwtext
  165.     .byte    DBTXTSTR,26,31
  166. @;ask user for day of week
  167. DayofWeek:    LoadW    r0,#DoWBox
  168.     jsr    DoDlgBox
  169.     sbc    #10
  170.     sta    dayowk
  171. DoWBox:    .byte    DEF_DB_POS | 1
  172.     .byte    DBTXTSTR,16,18
  173.     .word    dwtext
  174.     .byte    DBTXTSTR,26,31
  175.     .word    suntext
  176.     .byte    DBTXTSTR,138,31
  177.     .word    montext
  178.     .byte    DBTXTSTR,26,45
  179.     .word    tuetext
  180.     .byte    DBTXTSTR,138,45
  181.     .word    wedtext
  182.     .byte    DBTXTSTR,26,59
  183.     .word    thutext
  184.     .byte    DBTXTSTR,138,59
  185.     .word    fritext
  186.     .byte    DBTXTSTR,90,73
  187.     .word    sattext
  188.     .byte    DBUSRICON,2,24
  189.     .word    sunicontbl
  190.     .byte    DBUSRICON,16,24
  191.     .word    monicontbl
  192.     .byte    DBUSRICON,2,38
  193.     .word    tueicontbl
  194.     .byte    DBUSRICON,16,38
  195.     .word    wedicontbl
  196.     .byte    DBUSRICON,2,52
  197.     .word    thuicontbl
  198.     .byte    DBUSRICON,16,52
  199.     .word    friicontbl
  200.     .byte    DBUSRICON,10,66
  201.     .word    saticontbl
  202.     .byte    0
  203. dwtext:    .byte    BOLDON,"Select Day of Week",PLAINTEXT,0
  204. suntext:    .byte    "Sun",0
  205. montext:    .byte    "Mon",0
  206. tuetext:    .byte    "Tues",0
  207. wedtext:    .byte    "Wed",0
  208. thutext:    .byte    "Thurs",0
  209. fritext:    .byte    "Fri",0
  210. sattext:    .byte    "Sat",0
  211. sunicontbl:    .word    boxicon
  212.     .byte    0,0,1,8
  213.     .word    SunRtn
  214. monicontbl:    .word    boxicon
  215.     .byte    0,0,1,8
  216.     .word    MonRtn
  217. tueicontbl:    .word    boxicon
  218.     .byte    0,0,1,8
  219.     .word    TueRtn
  220. wedicontbl:    .word    boxicon
  221.     .byte    0,0,1,8
  222.     .word    WedRtn
  223. thuicontbl:    .word    boxicon
  224.     .byte    0,0,1,8
  225.     .word    ThuRtn
  226. friicontbl:    .word    boxicon
  227.     .byte    0,0,1,8
  228.     .word    FriRtn
  229. saticontbl:    .word    boxicon
  230.     .byte    0,0,1,8
  231.     .word    SatRtn
  232. boxicon:
  233. @;dialog box dispatch routines
  234. SunRtn:    LoadB    sysDBData,#11
  235.     jmp    RstrFrmDialogue
  236. MonRtn:    LoadB    sysDBData,#12
  237.     jmp    RstrFrmDialogue
  238. TueRtn:    LoadB    sysDBData,#13
  239.     jmp    RstrFrmDialogue
  240. WedRtn:    LoadB    sysDBData,#14
  241.     jmp    RstrFrmDialogue
  242. ThuRtn:    LoadB    sysDBData,#15
  243.     jmp    RstrFrmDialogue
  244. FriRtn:    LoadB    sysDBData,#16
  245.     jmp    RstrFrmDialogue
  246. SatRtn:    LoadB    sysDBData,#17
  247.     jmp    RstrFrmDialogue
  248. tmphrs:    .block    1
  249. tmpsecs:    .block    1
  250. tmpmins:    .block    1
  251. dayowk:    .block    1
  252. ]`323333333333
  253. ]`191010110101
  254.